package com.chenzhou.service;

import com.chenzhou.dao.GoodsDAOImpl;
import com.chenzhou.entity.GoodsEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsService {

    @Autowired
    private GoodsDAOImpl dao;

    public List<GoodsEntity> queryAllGoodsEntity(){
        return dao.queryAllGoodsEntity();
    }

    public GoodsEntity queryGoodsEntityOne(Integer id){
        return dao.queryGoodsEntityByID(id);
    }

    public int add_GoodsEntity(GoodsEntity goodsEntity){
        return dao.add_GoodsEntity(goodsEntity);
    }

    public int modify_GoodsEntity(GoodsEntity goodsEntity){
        return  dao.update_GoodsEntity(goodsEntity);
    }
    public int delete_GoodsEntity(Integer id){
        return dao.delete_GoodsEntity(id);
    }

    public List<GoodsEntity> queryGoodsEntityByStatus(Integer status){
        return dao.queryGoodsEntityBystatus(status);
    }

    public int modify_goodsStatus(Integer id,Integer status){
        return dao.modify_goodsStatus(id,status);
    }
}
